﻿@model WebSite.ViewModel.Tasks.TaskIndexVM
@{
    ViewData["Title"] = "任务列表";
}

<div>
<script src="~/lib/jquery/dist/jquery.js"></script>

</div>
<div>
    <ul>
        @foreach (var task in Model.Tasks)
        {
            <li>
                @task.Title|@task.Description|@(task?.AssignedPersonName??"无")|<a href="javascript:;" taskid="@task.ID" onclick="finish(this)">完成</a>
            </li>
        }
    </ul>
</div>
<script>
    function finish(obj) { 
        var id=$(obj).attr("taskid");
        $.ajax({
            type: "POST",
            url: "/Tasks/FinishTask",
            data: { taskid: id },
            success: function (msg) {
            }
        });

    }
</script>

